import React, { useEffect, useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import { Button } from 'antd';
import TableHeader from '../../../component/TableHeader';
import '../../../style/detail.scss'
import { sale_discount_detail } from '../../../utils/sale'
function Detail(props) {
    var [params, setParams] = useSearchParams();
    var [data, setData] = useState(params.get("data"));
    var [arr, setArr] = useState([])
    useEffect(() => {
        sale_discount_detail({ id_like: data }).then((res) => {
            setArr(res.data)
        })
    }, [])
    return (
        <div className='detail'>
            <TableHeader header={"营销 / 限时折扣 / 详情"} name={"折扣详情"}></TableHeader>
            {
                arr.map((item) => {
                    return (
                        <div className='means'>
                            <div className='boxone'>
                                <p className='title'>相关资料</p>
                                <img src="https://img0.baidu.com/it/u=779478669,1772130263&fm=253&fmt=auto&app=138&f=JPEG?w=501&h=500" alt="" />
                                <Button type="primary">返回</Button>
                            </div>
                            <div className='boxtwo'>
                                <div>活动名称:{item.name}</div>
                                <div>原价:</div>
                                <div>折扣价:</div>
                                <div>库存:</div>
                            </div>
                            <div className='boxthree'>
                                <div>活动负责人:</div>
                                <div>折扣商品:</div>
                                <div>销售量：</div>
                            </div>
                        </div>
                    )

                })
            }
            <Button type="primary">返回</Button>

        </div>
    );
}

export default Detail;